using System;
using System.Collections.Generic;
using System.Text;
using Com.AlbLab.GEP.Domain;
using Com.AlbLab.GEP.Domain.Entities;
using Com.AlbLab.GEP.Dao.Interface;
using Com.AlbLab.GEP.Services.Base;
using Com.AlbLab.GEP.Services;

namespace Com.AlbLab.GEP.Services.Impl
{
    public class UtenteService : BaseClassic, IUtenteService
    {
        #region IUtenteService Members

        public Dictionary<decimal,UtenteEntity> getListaUtenti()
        {
            return base.DbProvider.DaoImpl.UtenteDao.GetAll();
        }

        public UtenteEntity getUtenteByID(decimal userId)
        {
            return base.DbProvider.DaoImpl.UtenteDao.GetById(userId);
        }

        public UtenteEntity getUtenteByUsername(string username)
        {
            return base.DbProvider.DaoImpl.UtenteDao.findByUserName(username);
        }

        public UtenteEntity insertUtente(UtenteEntity e)
        {
            e.Password = "password";
            base.DbProvider.DaoImpl.UtenteDao.Insert(e);
            return e;
        }

        public UtenteEntity updateUtente(UtenteEntity e)
        {
            base.DbProvider.DaoImpl.UtenteDao.Update(e);
            return e;
        }

        public UtenteEntity resetPassword(UtenteEntity e)
        {
            e.Password = "password";
            base.DbProvider.DaoImpl.UtenteDao.Update(e);
            return e;
        }

        public void deleteUtente(decimal e)
        {
            base.DbProvider.DaoImpl.UtenteDao.Delete(e);
        }

        #endregion
    }
}
